.TH GIT\-FTP 1 18/10/2011 HEAD "Git Manual"
.SH "NAME"
git-ftp \- Quick and efficient publishing of Git repositories over FTP


.SH "SYNOPSIS"
.sp
.nf
\fIgit ftp\fR [(\-\-force | \-f)] [(\-\-quiet | \-q)]
        [(\-\-revision | \-r) <commit>] [(\-\-commit | \-c) <commit>]
        [(\-\-branch | \-b) <branch>] [(\-\-section | \-s) <section>]
.fi
.sp


.SH "DESCRIPTION"
.sp
Some web hosts only give you FTP access to the hosting space, but you would
still like to use Git to version the contents of your directory. You could
upload a full tarball of your website every time you update, but that's
wasteful. \fIgit ftp\fR only uploads the files that changed.


.SH "OPTIONS"

.PP
\-f, \-\-force
.RS 4
Force the reupload of all files instead of just the changed ones\&.
.RE

.PP
\-q, \-\-quiet
.RS 4
Display only errors and warnings\&.
.RE

.PP
\-r <commit>, \-\-revision=<commit>
.RS 4
The SHA of the current revision is stored in \fIgit-rev.txt\fR on the server.
Use this revision instead of the server stored one, to determine which files
have changed\&.
.RE

.PP
\-c <commit>, \-\-commit=<commit>
.RS 4
Upload this commit instead of HEAD or the tip of the selected branch\&.
.RE

.PP
\-b <branch>, \-\-branch=<branch>
.RS 4
Use this branch instead of the active one\&.
.RE

.PP
\-s <section>, \-\-section=<section>
.RS 4
Use this section of the ftpdata file instead of the active branch name\&.
.RE

.SH "FTP CREDENTIALS"
.sp
You can place FTP credentials in \fI.git/ftpdata\fR, as such:
.sp
.if n \{\
.RS 4
.\}
.nf
[master]
username=me
password=s00perP4zzw0rd
hostname=ftp.hostname.com
remotepath=/htdocs
ssl=yes

[staging]
username=me
password=s00perP4zzw0rd
hostname=ftp.hostname.com
remotepath=/htdocs/staging
ssl=no
.fi
.if n \{\
.RE
.\}
.sp
Each section corresponds to a Git branch. If you don't create the configuration
file, \fIgit ftp\fR will interactively prompt you.
.sp
FTP SSL support needs Python 2.7 or later.


.SH "EXCLUDING FILES FROM UPLOADING"
.sp
Similarly to \fI.gitignore\fR you can exclude files from uploading.
.sp
The default file with ignore patterns is \fI.gitftpignore\fR in project root,
however you can specify your own for every branch in .git/ftpdata:
.sp
.if n\{\
.RS 4
.\}
.nf
[branch]
 ... credentials ...
gitftpignore=.my_gitftpignore
.fi
.if n\{\
.RE
.\}
.sp
Used syntax is same as gitignore's with the exception of overriding patterns,
eg. "\fI!\fRsome/pattern", which is not supported.
Negations within patterns works as expected.


.SH "USING A BARE REPOSITORY AS A PROXY"
.sp
An additional script \fIpost-recieve\fR is provided to allow a central bare
repository to act as a proxy between the git users and the ftp server.
.sp
Pusing on branches that don't have an entry in the \fIftpdata\fR configuration file will have the default Git behaviour - nothing will be pushed over ftp.
.sp
One advantage is that users do not get to know the ftp credentials (perfect for
interns).
.sp
This is how the workflow looks like:
.sp
.if n \{\
.RS 4
.\}
.nf
User 1 --+                              +--> FTP Staging
          \\                            /
User 2 -------> Bare Git repository -------> FTP Master
          /                            \\
User 3 --+                              +--> FTP Dev
.fi
.if n \{\
.RE
.\}
.sp
This is how the setup looks like (one \fIftpdata\fR configuration file and a
symlink to the update hook):
.sp
.if n \{\
.RS 4
.\}
.nf
user@server:/path-to-repo/repo.git$ ls
HEAD  ORIG_HEAD  branches  config  description  ftpdata  hooks  info

user@server:/path-to-repo/repo.git/hooks$ ls -l
lrwxr-xr-x 1  user user  post-recieve -> /path-to-git-ftp/post-recieve
.fi
.if n \{\
.RE
.\}


.SH "LICENSE"
.sp
Copyright (c) 2008 - 2011
Edward Z. Yang <ezyang@mit.edu>, Mauro Lizaur <mauro@cacavoladora.org> and
Niklas Fiekas <niklas.fiekas@googlemail.com>
.sp
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
.sp
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
.sp
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.


.SH "REPORTING BUGS"
Report bugs in the issue queue on Github
<https://github.com/ezyang/git-ftp/issues> or email one of the authors.


.SH "GIT"
.sp
Used as a part of the \fBgit\fR(1) suite.
